<?php

namespace Biz\Requests\Site;

use Illuminate\Validation\Rule;
use Biz\Dictionaries\CurrencyDict;
use Lumen\Validation\Validators\RequestValidator;

/**
 * SiteOrderRegistrationFeeRequest.
 *
 * @license [http://www.85do.com] [杭州永奥网络科技有限公司]
 * @copyright Copyright (c) 2018-2026 Hangzhou Yongao Technology Co., Ltd. All rights reserved.
 */
class SiteOrderRegistrationFeeRequest extends RequestValidator
{
    /**
     * Get custom rules for validator errors.
     *
     * @return array
     */
    public function rules(): array
    {
        return [
            'currency'               => [
                'required',
                'string',
                'distinct',
                'max:6',
                Rule::in(CurrencyDict::keys()),
            ],
            'total_amount'                                               => 'required|numeric|min:0.01',
            'registration_fee'                                           => 'required',
            'registration_fee.fee_name'                                  => 'required|string|max:255',
            'registration_fee.registration_no'                           => 'required|string|max:255',
            'registration_fee.price'                                     => 'required|numeric|min:0',
            'registration_fee.accompany_price'                           => 'required|numeric|min:0',
            'registration_fee.accompany_number'                          => 'required|integer|max:300',
            'registration_fee.remark'                                    => 'max:255',
        ];
    }
}
